<include file="Public/inc/header.html" />
    <section class='content'>
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title">仓库列表</h3>
                    </div><!-- /.box-header -->
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <tr>
                                <th>仓库名称</th>
                                <th>使用率</th>
                                <th>仓库地址</th>
                                <th>操作</th>
                            </tr>
                            <foreach name='data' item='vo'>
                                <tr>
                                    <td>{$vo.name}</td>
                                    <!--<td>%</td>-->
                                    <td>
                                        <div class="progress">
                                            <div class="progress-bar <if condition='$vo.use_rate lt 0.5'>progress-bar-success<elseif condition='$vo.use_rate lt 0.7'/>progress-bar-warning<else />progress-bar-danger</if> progress-bar-striped active" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="min-width: 2em; width: {$vo['use_rate']*100}%;">
                                                {$vo['use_rate']*100}%
                                                <!--<span class="sr-only">40% Complete (success)</span>-->
                                            </div>
                                        </div>
                                    </td>
                                    <td>{$vo.address}</td>
                                    <td>
                                        <button type="button" data-id="{$vo['id']}" class="btn btn-danger delete" data-toggle="modal" data-target="#myModal">删除</button>　
                                        <a href="/drm/index.php/Home/Respo/Index/depotEdit.html?id={$vo['id']}"><button type="button" data-id="{$vo['id']}" class="btn btn-warning">编辑</button></a>
                                    </td>
                                </tr>
                            </foreach>
                        </table>
                    </div><!-- /.box-body -->
                </div><!-- /.box -->
            </div>
        </div>
    </section>
    <include file="Public/inc/footer.html" />
        <script>
            $('.delete').click(function(){
                var id = $(this).data('id');

                $('#yes').click(function(){
                    $.post('/drm/index.php/Home/Respo/Index/depotDelete.html',{'id':id},function(){
                        window.location.reload();
                    })
                })
            })
        </script>
